<?php

namespace App\Http\Controllers\YApi;

//use Illuminate\Http\Request;
use Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;

use Session;
use Redirect;

use App\Models\UsersReg;

class SearchUserController extends Controller
{

    public function searchuser()
    {
        // 根据关键字搜索图书
        $search_text = request::input('search_text');
        $pre_page = 15;
        $userlist = UsersReg::where('user_name', 'like', '%'.trim($search_text).'%')
                        ->orderBy('reg_time', 'desc')
                        ->paginate($pre_page);
        
        return $userlist;
    }
    
}